package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Setter@Getter@ToString
@JsonIgnoreProperties(value = {"handler"})
public class Employee extends BaseDomain{

    public final static int STATE_NORMAL = 0; //表示在职
    public final static int STATE_QUIT = 1; //表示离职

    private String username;

    private String realname;

    private String password;

    private String tel;

    private String email;

    private Department dept;

    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date inputTime;

    private int state;

    private boolean admin;

    //员工与角色多对多关系
    private List<Role> roles = new ArrayList<>();
}